import { useEffect } from 'react'
import Taro, { useDidShow, useDidHide } from '@tarojs/taro'
// 全局样式
import './app.sass'
import authorizationStore from "./store/AuthorizationStore";

function App(props) {
  // 可以使用所有的 React Hooks
  useEffect(() => {})

  // 对应 onShow
  useDidShow(() => {})

  // 对应 onHide
  useDidHide(() => {})

  useEffect(() => {
    // noinspection ES6MissingAwait
    (async () => {
      if (authorizationStore.hasLogIn) {
        return
      }else {
        Taro.reLaunch({url: "/pages/logIn"})
      }
    })()
  }, [authorizationStore.hasLogIn])

  return props.children
}

export default App
